cmake_minimum_required( VERSION 2.8 )
project( BA )

# 添加c++ 11标准支持
set( CMAKE_CXX_FLAGS "-std=c++11" )


find_package( OpenCV REQUIRED )


# 添加g2o的依赖
# 因为g2o不是常用库，要添加它的findg2o.cmake文件
# set( G2O_ROOT /usr/local/include/g2o )
# LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )
# find_package( G2O REQUIRED )
# find_package( CSparse REQUIRED )

# 头文件文件夹
set(G2O_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/3dpart/g2o")
set(SOPHUS_DIRS "${PROJECT_SOURCE_DIR}/3dpart/Sophus")
set(EIGEN_DIR "/usr/include/eigen3")





# 添加头文件
include_directories( 
        ${EIGEN_DIR}
        ${OpenCV_INCLUDE_DIRS}
        ${G2O_INCLUDE_DIRS}
        ${SOPHUS_DIRS}
        )

add_executable( BA BA-3Dto2D.cpp )

target_link_libraries( BA
        ${OpenCV_LIBS}
        ${G2O_INCLUDE_DIRS}/lib/libg2o.so
        )


